package com.swh.xbsc.mapper;

import com.alibaba.excel.util.StringUtils;
import org.apache.ibatis.jdbc.SQL;

import java.util.Map;

/**
 * @Author: swh
 * @Description:
 * @Date: 2020/11/19 20:07
 * @Version: 1.0
 */
public class UserFocusProvider {
    public String selectPage(Map<String, Object> map) {
        return new SQL() {{
            SELECT("uf.*,us.real_name ");
            FROM(" user_focus uf ,`user` us");
            WHERE(" us.id = uf.user_focus_id ");
            WHERE("uf.user_focus_id <> uf.user_id");
            if (map.containsKey("id") && !StringUtils.isEmpty(map.get("id"))) {
                WHERE("uf.user_id=#{id}");
            }
        }}.toString();
    }

}
